using System;
using System.Collections.Generic;
using System.Text;

namespace GSN.Config
{
    public abstract class IDictionaryConfigurator : IConfigurator
    {
        private Dictionary<string, string> data = new Dictionary<string, string>();
        //private bool _passwordsEncrypted = false;

        /*public IDictionaryConfigurator(bool passwordsEncrpyted)
        {
            _passwordsEncrypted = passwordsEncrpyted;
        }*/

        #region IConfigurator Members

        /*public string getEncryptedString(string key)
        {
            string str = getItemString(key);
            if (_passwordsEncrypted)
                str = CryptUtils.decrypt(str);

            return str;
        }

        public void setEncryptedString(string value, string key)
        {
            string str = value;
            if (_passwordsEncrypted)
                str = CryptUtils.encrypt(str);

            setItemString(str, key);
        }*/

        public void setItemString(string value, string key)
        {
            data[key] = value;
        }

        public string getItemString(string key)
        {
            return (data.ContainsKey(key)?data[key]:null);               
        }

        void IConfigurator.setItemStringArray(string[] value, string key)
        {
            throw new Exception("The method or operation is not implemented.");
        }

        string[] IConfigurator.getItemStringArray(string key)
        {
            throw new Exception("The method or operation is not implemented.");
        }

        abstract public bool show();

        #endregion
    }
}
